# Maintainer: David Macek <david.macek.0@gmail.com>

pkgname=xdelta3
pkgver=3.0.8
pkgrel=1
pkgdesc='Diff utility which works with binary files'
arch=('x86_64' 'i686')
url='http://xdelta.org/'
license=('GPL')
depends=('xz')
source=("http://${pkgname/3}.googlecode.com/files/${pkgname}-${pkgver}.tar.xz"
        '0001-regtest_size_t.patch'
        '0002-disable-permission-test.patch')
sha1sums=('62c7a029e96c0904bb47a5e2f3de08473a185539'
          'c2816b5d4bfb405d3adb771fa09b367a88971240'
          '1f7d75843b6a90786355186ac6493ea687211d6c')

prepare() {
  cd "${pkgname}-${pkgver}"
  patch -Np1 -i "${srcdir}/0001-regtest_size_t.patch"
  patch -Np1 -i "${srcdir}/0002-disable-permission-test.patch"
}

check() {
  cd "${pkgname}-${pkgver}"
  ./$pkgname test
}

build() {
  cd "${pkgname}-${pkgver}"
  ./configure --prefix=/usr --build=${CHOST}
  make
}

package() {
  cd "${pkgname}-${pkgver}"
  make DESTDIR="${pkgdir}" install
}
